package com.zf.developaccumulate.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.time.LocalDate;

/**
 * 开始、结束日期对象
 */
@Getter
@Setter
@ToString
public class StartEndDateVO {
    /**
     * 开始时间
     */
    private LocalDate startDate;
    /**
     * 结束时间
     */
    private LocalDate endDate;
    /**
     * 其他值
     */
    private Integer qty;


    public StartEndDateVO(LocalDate startDate, LocalDate endDate, Integer qty) {
        if (!endDate.isAfter(startDate)) {
            throw new RuntimeException("开始时间必须 < 结束时间");
        }

        this.startDate = startDate;
        this.endDate = endDate;
        this.qty = qty;
    }
}
